
<#include "/base/common/head.html"/>


 <div class="easyui-panel updatePage multiple" data-options="fit:true,border:false">
    <form id="ff" class="easyui-form" method="post">
        <table class="table1">
           
             <tr>
           		<th><span>编号</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="code" id="code" value="${bo.code!''}" addClear  tabindex="1" data-options="required:true,fit: true"  ></input></div>
           		</td>
           		<th><span>保险到期日期</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-datebox" type="text" name="insuranceDate" id="insuranceDate" value="${bo.insuranceDate!''}" addClear  tabindex="7" data-options="fit: true,editable:false"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span>名称</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="name" id="name" value="${bo.name!''}" addClear  tabindex="2" data-options="required:true,fit: true"  ></input></div>
           		</td>
           		<th><span>保养日期</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-datebox" type="text" name="upkeepDate" id="upkeepDate" value="${bo.upkeepDate!''}" addClear  tabindex="8" data-options="fit: true,editable:false"></input></div>
           		</td>
            </tr>
            
            <tr>
           		<th><span>车牌号</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="carNumber" id="carNumber" value="${bo.carNumber!''}" addClear  tabindex="3" data-options="required:true,fit: true"></input></div>
           		</td>
           		<th><span>上次保养里程</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-numberbox" type="text" name="upkeepNum" id="upkeepNum" value="<#if bo.upkeepNum??>${bo.upkeepNum?c}</#if>" addClear  tabindex="9" data-options="fit: true,precision:0"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span>车辆类型</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-combobox" type="text" name="carType.id" id="carType.id" value="${bo.carType.id!''}"  addClear  tabindex="4"
               			data-options="required:true,fit: true,valueField:'id',textField:'name',url:'${basePath}/base/basis/sort/findAll?key=carSort',editable:false"></input></div>
           		</td>
           		<th><span>本次保养里程</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-numberbox" type="text" name="nextUpkeepNum" id="nextUpkeepNum" addClear  tabindex="10"
               			 value="<#if bo.nextUpkeepNum??>${bo.nextUpkeepNum?c}</#if>" data-options="fit: true"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span>发动机编号</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="engineNumber" id="engineNumber" value="${bo.engineNumber!''}" addClear  tabindex="5" data-options="fit: true"></input></div>
           		</td>
           		<th><span>默认司机</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="driver" id="driver" value="${bo.driver!''}" addClear  tabindex="11" data-options="fit: true"  ></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span>底盘编号</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="chassisNumber" id="chassisNumber" value="${bo.chassisNumber!''}" addClear  tabindex="6" data-options="fit: true"></input></div>
           		</td>
           		<th><span>备注</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="remark" id="remark" value="${bo.remark!''}" addClear  tabindex="12" data-options="fit: true"></input></div>
           		</td>
            </tr>
          
        </table>
    </form>
</div>
<script>
top.window.subPage.save = save;
function save() {
	if($("#zcurdHeadTable").form('validate')) {
		$.post("update", getParam(), function(data) {
			
			if("01" == data.code){//成功
				top.window.closeWindow(); //关闭窗口
				top.window.subPage.loadCurrDatagrid(); //回调方法
				showMsg(data.msg); //显示消息
				
			}else if("04" == data.code){//失败
				showErrorMsg(data.msg); //显示错误消息
			}
			
		});
	}
}
function getParam() {
	var param = {
	     
	    "id": ${bo.id?c}, 
	    "obj.code": getInputValue("code"), 
   		"obj.name": getInputValue("name"), 
   		"obj.carNumber": getInputValue("carNumber"), 
   		"obj.driver": getInputValue("driver"), 
   		"obj.carStatus": getInputValue("carStatus"), 
   		"obj.endNum": getInputValue("endNum"), 
   		"obj.carType.id": getInputValue("carType.id"), 
   		"obj.engineNumber": getInputValue("engineNumber"), 
   		"obj.chassisNumber": getInputValue("chassisNumber"), 
   		"obj.insuranceDate": getInputValue("insuranceDate"), 
   		"obj.upkeepDate": getInputValue("upkeepDate"), 
   		"obj.upkeepNum": getInputValue("upkeepNum"),  
   		"obj.nextUpkeepNum": getInputValue("nextUpkeepNum"), 
   		"obj.remark": getInputValue("remark")
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

$(function(){
	autoAddClear(); //为各组件自动填加‘清除’功能（组件需要增加 addClear属性 ）
	addChangeFocusOpe(); //页面增加焦点切换操作
	$("#code").next("span").find("input").focus();  //第一个元素设置焦点
		
});

</script>
<#include "/base/common/foot.html"/>
